package com.jinandi.app.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * <权限表>
 * @author CGC
 * @version [记录版本号, 2013-4-24]
 */
@Entity
@Table(name = "JND_RESOURCE")
public class Resource extends ManagedIdentityDomainObject<Resource>{

	private static final long serialVersionUID = -6553321720677305413L;

	private String url; //资源路径
	
	private List<AuthoritAndRes> authiritAndRes; //那个角色拥有访问该资源
	
	@JsonIgnore
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "resource")
	public List<AuthoritAndRes> getAuthiritAndRes() {
		return authiritAndRes;
	}
	
	public void setAuthiritAndRes(List<AuthoritAndRes> authiritAndRes) {
		this.authiritAndRes = authiritAndRes;
	}



	@Column(name = "url", nullable = false, unique = false)
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
